/*
 * Attack.h
 *
 *  Created on: 16/01/2011
 *      Author: Nenem
 */

#ifndef ATTACK_H_
#define ATTACK_H_

#include "Tools.h"
#include "Direction.h"
#include "Position.h"
#include "Fight.h"
#include "Hitted.h"

#include "vector"
using namespace std;

struct AttackPoints{
	Point2D north;
	Point2D south;
	Point2D east;
	Point2D west;
};

class Attack {
private:
    Information east;
    Information west;
    Information north;
    Information south;
    int precision;
    int basePrecision;
    int damage;
    int baseDamage;
    int attackSpeed;
    int baseAttackSpeed;
    int recoverySpeed;
    int baseRecoverySpeed;
    int lastAttackTime;
    Position *position;
    int time;
    int owner;
public:
    vector<int> hitteds;

    Attack();
    Attack(int baseAttackSpeed);
    virtual ~Attack();
    Rectangle getAttackArea(Position *position, Direction *direction);
    void update(int delta, int time, Position *position, Direction *direction, Fight *fight);
    bool find(int i);

    int getOwner() const
    {
        return owner;
    }

    void setOwner(int owner)
    {
        this->owner = owner;
    }

    Information getEast() const
    {
        return east;
    }

    Information getNorth() const
    {
        return north;
    }

    Information getSouth() const
    {
        return south;
    }

    Information getWest() const
    {
        return west;
    }

    void setEast(Information east)
    {
        this->east = east;
    }

    void setNorth(Information north)
    {
        this->north = north;
    }

    void setSouth(Information south)
    {
        this->south = south;
    }

    void setWest(Information west)
    {
        this->west = west;
    }

    int getLastAttackTime() const
    {
        return lastAttackTime;
    }

    void setLastAttackTime(int lastAttackTime)
    {
        this->lastAttackTime = lastAttackTime;
    }

    int getAttackSpeed() const
    {
        return attackSpeed;
    }
};

#endif /* ATTACK_H_ */
